<?
include("common/header.html");
include("../_made/le.cfg.php");
include("common/left.html");
include("common/page.php");
// $_SESSION['useTer'] = 1;
// print_r($_SESSION);
$ac=$GLOBALS['_ac'];
$pw=$GLOBALS['_pw'];
$s = new SoapClient(null,array("location" => "http://localhost/open/openService/pft_insideMX.php","uri" => "www.16u.com?ac_16u=$ac|pw_16u=$pw|auth_16u=true"));
if(!$_SESSION['memberID']){exit("<script>window.location='dlogin.html'</script>");}
$currentPage=$_REQUEST["currentPage"]?$_REQUEST["currentPage"]:1;
$pageSize=$_REQUEST['pageSize']?$_REQUEST["pageSize"]:10;
$txt=$_REQUEST['txt'];
$tpl=$b=$a=$a_sort=array();
if($txt && $txt!="请输入员工名称\账号\手机"){
	$tj=" and (instr(dname,'".$txt."') or account='".$txt."' or mobile='".$txt."')";
}
$ltitle="员工列表";
$sel1="select m.id,dname,account,mobile,m.status,lasttime ";
$sel2="select count(*) total ";
$sel="from pft_member_relationship r left join pft_member m on m.id=son_id where m.status in (0,1) ".$tj." and r.status=0 and parent_id=".$_SESSION['sid']." and ship_type=1 and son_id_type=2".($_SESSION['dtype']==6?" and m.id<>".$_SESSION['memberID']:"");
$GLOBALS['le']->query($sel1.$sel." limit ".($currentPage-1)*$pageSize.",".$pageSize);
while($row=$GLOBALS['le']->fetch_assoc()){
	$row['zt']=$row['status']==0?"正常":"禁用";
	$row['cz']=$row['status']==0?"禁用":"启用";
	$a_sort[]=$row;
}
$GLOBALS['le']->query($sel2.$sel);
$GLOBALS['le']->fetch_assoc();
$total=$GLOBALS['le']->f("total");
$txt=$txt?$txt:"请输入员工名称\账号\手机";

include("tpl/operlist.html");
include("common/footer.html");?>